package com.itheima.controller;

import com.itheima.common.Result;
import com.itheima.pojo.Category;
import com.itheima.service.CategoryService;
import com.itheima.vo.CategoryVo;
import com.itheima.vo.UserCategoryVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author :WuJunJie
 * packageName :com.itheima.controller
 * fileName :CategoryController
 * creationTime :2022-11-27 10:37
 */
@RestController
@RequestMapping("category")
@Slf4j
public class CategoryController {
    @Autowired
    private CategoryService categoryService;

    @GetMapping("list")
    public Result selectCtegories(){
        List<UserCategoryVo> categories=categoryService.selectCategories();
        return Result.success(categories);
    }
}
